#include "template_method.h"

#include <iostream>

AbstractClass::AbstractClass()
{}

AbstractClass::~AbstractClass()
{}

void AbstractClass::TemplateMethod()
{
	this->Step1();
	this->Step2();
}

ConcreteClass1::ConcreteClass1()
{
	std::cout << "create ConcreteClass1 instance" << std::endl;
}

ConcreteClass1::~ConcreteClass1()
{
	std::cout << "release ConcreteClass1 instance" << std::endl;
}

void ConcreteClass1::Step1()
{
	std::cout << "ConcreteClass1 step1" << std::endl;
}

void ConcreteClass1::Step2()
{
	std::cout << "ConcreteClass1 Step2" << std::endl;
}

ConcreteClass2::ConcreteClass2()
{
	std::cout << "create ConcreteClass2 instance" << std::endl;
}

ConcreteClass2::~ConcreteClass2()
{
	std::cout << "release ConcreteClass2 instance" << std::endl;
}

void ConcreteClass2::Step1()
{
	std::cout << "ConcreteClass2 step1" << std::endl;
}

void ConcreteClass2::Step2()
{
	std::cout << "ConcreteClass2 Step2" << std::endl;
}
